import { ComponentInfoModel } from '../model/component-info.model';
import { Observable } from 'rxjs/Observable';
import { InjectionToken } from '@angular/core';

export interface ILayoutService {

    getComponents(): Map<string, ComponentInfoModel[]>;

    getBackupComponents(): ComponentInfoModel[];

    getComponentData(componentKey: string): Observable<ComponentInfoModel>;

    getUserComponentWithDefaults(targetUsers: string, componentType?: string): Observable<ComponentInfoModel>;

    getUserComponents(targetUser: string, componentType?: string): Observable<ComponentInfoModel>;

    insertLayoutComponent(layoutComponent: ComponentInfoModel): Promise<boolean>;

    deleteLayoutComponent(layoutComponentKey: string): Promise<boolean>;

    renameLayoutComponent(newName: string, layoutComponentKey: string): Promise<boolean>;

    resetComponentDefaults(componentType: string): Promise<boolean>;

    createEntity(): ComponentInfoModel;

    importTemporaryLayouts(importEntities: ComponentInfoModel[]): void;

    getReadOnlyMode(): boolean;
}

export const LAYOUT_SERVICE = new InjectionToken('LAYOUT_SERVICE');